import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import AutoHomeView from "@/views/categoryHomepage/AutoHomeView.vue";
import GamesView from "@/views/categoryHomepage/GamesView.vue";
import TechnologyView from "@/views/categoryHomepage/TechnologyView.vue";
import AmusementView from "@/views/categoryHomepage/AmusementView.vue";
import SportsView from "@/views/categoryHomepage/SportsView.vue";
import ArticleView from "@/views/ArticleView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: { homeHeader: true }
    },
    {
      path: '/tech',
      name: 'tech',
      component: TechnologyView,
    },
    {
      path: '/sports',
      name: 'sports',
      component: SportsView,
    },
    {
      path: '/auto',
      name: 'auto',
      component: AutoHomeView,
    },
    {
      path: '/auto/:id',
      name: 'auto-article',
      component: ArticleView,
      meta: { category: '汽车' }
    },
    {
      path: '/games',
      name: 'games',
      component: GamesView,
    },
    {
      path: '/amusement',
      name: 'amusement',
      component: AmusementView,
    },
    // 这里添加路由
  ],
})

export default router
